<template>
	<view class="page-body">
			<view class="bg-white p20">
				<image :src="baseUrl+img_url" @click="app.showImg(baseUrl+img_url)" style="width: 100%;" mode="widthFix"></image>
			</view>
		<bottomShare :imgFile="baseUrl+img_url" :url="baseUrl+share_url"></bottomShare>
	</view>
</template>


<script>
	import bottomShare from '@/components/bottomShare';
	export default {
		components: {
			bottomShare
		},
		data() {
			return {
				goods_id:0,
				is_wxmp:0, 
				img_url:'',
				baseUrl:this.config.baseUrl,
				share_url:''
			}
		},
		onLoad(options) {
			this.app.isLogin(this); //强制登陆
			this.goods_id = options.goods_id;
			this.getImg();
		},
		onShow: function() {},
		computed: {},
		onReady() {
		},
		methods: {
			getImg(){
				//#ifdef MP-WEIXIN
					this.is_wxmp = 1;
				//#endif
				this.$u.post('shop/api.goods/getShareImg',{isnew:1,goods_id:this.goods_id,is_wxmp:this.is_wxmp}).then(res => {
					this.img_url = res.data.img;
					this.share_url = res.data.share_url
				});
			}
		}
	}
</script>

<style lang="scss">
</style>
